<!DOCTYPE html>
<html>
<head>
    <title>Global Object URI Decoding Example</title>
    <script type="text/javascript">
    
        var uri = "http%3A%2F%2Fwww.wrox.com%2Fillegal%20value.htm%23start";
        
        //http%3A%2F%2Fwww.wrox.com%2Fillegal value.htm%23start
        alert(decodeURI(uri));
        
        //http://www.wrox.com/illegal value.htm#start
        alert(decodeURIComponent(uri));
        
    </script>
</head>
<body>

</body>
</html>